<!DOCTYPE html>
<html lang="zh-CN">
{% load staticfiles %}
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">
    {% block custom_css %}{% endblock %}

    <title>{% block title %}学厨网{% endblock %}</title>

    <!-- Bootstrap core CSS -->
    <link href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
    <script src="https://cdn.bootcss.com/jquery/1.12.4/jquery.min.js"></script>
    <script src="https://cdn.bootcss.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>

    {#    <style>#}
    {#        * {#}
    {#            margin: 0;#}
    {#            padding: 0;#}
    {#        }#}
    {##}
    {#        html,#}
    {#        body,#}
    {#        .mycontent {#}
    {#            height: 100%;#}
    {#            min-height: 100%;#}
    {#            margin-bottom: -80px;#}
    {#        }#}
    {##}
    {#        .footer {#}
    {#            width: 100%;#}
    {#            line-height: 70px;#}
    {#            height: 80px;#}
    {#            background: #333;#}
    {#            color: #fff;#}
    {#            font-size: 14px;#}
    {#        }#}
    {##}
    {##}
    {#    </style>#}
    <style>
        p {
            word-wrap: break-word;
            word-break: break-all;
            overflow: hidden;
        }
    </style>

</head>

<body>

<nav class="navbar navbar-inverse navbar-fixed-top">
    <div class="container">
        <div class="navbar-header">
            <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar"
                    aria-expanded="false" aria-controls="navbar">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <a class="navbar-brand" href="{% url 'index' %}">学厨网</a>
        </div>

        <div id="navbar" class="navbar-collapse collapse">
            <ul class="nav navbar-nav">
                <li {% if request.path == '/' %}class="active"{% endif %}><a href="{% url 'index' %}">首页</a></li>
                <li {% if request.path|slice:'9' == '/cookbook' %}class="active"{% endif %}><a
                        href="{% url 'cookbook:cookbook_list' %}">菜谱</a></li>
                <li {% if request.path|slice:'10' == '/community' %}class="active"{% endif %}><a
                        href="{% url 'community:community_list' %}">社区</a></li>
                <li><a href="javascript:void(0);">直播</a></li>
            </ul>
            {% if user.is_authenticated %}
                <ul class="nav navbar-nav navbar-right">
                    <li class="dropdown">
                        <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true"
                           aria-expanded="false">{{ user.username }} <span class="caret"></span></a>
                        <ul class="dropdown-menu">
                            <li><a href="{% url 'users:user_info' %}">个人中心</a></li>
                            <li role="separator" class="divider"></li>
                            <li><a href="{% url 'logout' %}">退出</a></li>
                        </ul>
                    </li>
                </ul>
            {% else %}
                <ul class="nav navbar-nav navbar-right">
                    <li class="bar-link bar-item bar-reg">
                        <a href="{% url 'register' %}">注册</a>
                    </li>
                    <li class="bar-link bar-item bar-reg">
                        <a href="{% url 'login' %}">登录</a>
                    </li>

                </ul>
            {% endif %}
            <form class="navbar-form navbar-right" action="{% url 'search' %}" method="post">
                <div class="form-group">
                    <input type="text" class="form-control" placeholder="菜谱名" name="search">
                </div>
                {% csrf_token %}
                <button type="submit" class="btn btn-default">搜索</button>
            </form>
        </div><!--/.navbar-collapse -->
    </div>
</nav>


{% block content %}
{% endblock %}

{#<footer class="footer">#}
{#    <p class="text-center">&copy; 2018 Company, 郑州大学.</p>#}
{#</footer>#}


<footer style="margin-top: 40px;">
    <p class="text-center">&copy; 2018 Company, 郑州大学.</p>
</footer>

</body>
</html>
